package com.company.libraryservice.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常处理器
 *
 * @author RoyMa
 * @date 2025-08-14
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
  @ExceptionHandler(RuntimeException.class)
  public ApiResp<Void> handle(RuntimeException e) {
    return ApiResp.fail(e.getMessage());
  }
}
